﻿//////////////////////////////////////////////////////////////////////////
// server module
// author   : zhangpeng
// date     : 2012-2-6
//////////////////////////////////////////////////////////////////////////
var http = require('http');
var url = require("url");

function start(route, handler) {
    http.createServer(function(req, res) {
        var postData = "";
        var pathName = url.parse(req.url).pathname;

        route(handler, pathName, res, req);
    }).listen(8888);

    console.log('Server running at 8888/');
}

exports.start = start;